<!DOCTYPE html>
<html>
<#include "/views/ftl/base/manager_include.ftl">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<base href="${basePath}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>创建座位</title>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl"> 
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "创建位置_List"></#function>
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>用餐座位</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>创建座位</span></a>
      </div>
    </div>
      

    <#--
    private String locationName;//1号桌  临时1号  外送
    private Integer locationType; //1.固定位置  2.临时添加位置  3.外送
    private Integer useStatus; //使用状态  1.无人  2.制作中 3.用餐中
      -->
  <!--表格列表-->
        <div class="fl">
          
          <div class="input_name" style="height:32px;margin-bottom: 20px;">
             <span class="left_title"  >位置名称：</span>
             <input type="text" name="locationName"  class="search_text tdd50" style="width:210px" value="">
          </div>
          
          <div class="input_name" style="height:32px;margin-bottom: 20px;">
             <span class="left_title"  >位置类型：</span>
             <select id="locationType"   class="sp" style="width: 220px;">
           			 <#list mealLocationTypeEnum as enum>
						 <option value="${enum.type}" >${enum.typeName}</option>
					 </#list>
			 </select>
          </div>

            <a style="margin-left: 220px;" id="save" class="yg-btn yg-btn-primary" href="javascript:void(0);"><span  >保存</span></a>
          
        </div>
        
</div>
</div>  
<script> 
$(function(){

	
	
	$("#save").click(function(){

		var locationType = $('#locationType').val();
		var locationName=$("input[name=locationName]").val();
		$.ajax({ 
			url : "${basePath}manager/MealLocation_createMealLocation",
			data : {
                locationType:locationType,
                locationName:locationName
			}, 
			dataType :"JSON",
			cache : false, 
			type : "POST",
			success : function(dat){
				if(dat.code==1){
					if(confirm("添加成功,继续添加?")){
                        window.location.href="${basePath}manager/MealLocation_createMealLocationPage";
					}else {
                        window.location.href="${basePath}manager/MealLocation_mealLocationListPage";
					}

				}else{
					alert(dat.msg);	
				} 
			}
		});
	});

});

</script>
</body>
</html>

